import yaml
class YamlUtil:

    def __init__(self,yaml_file):
        self.yaml_file = yaml_file

    #读取yaml文件
    def read_yaml(self):
        """
        yaml.load() 对yaml文件进行反序列化，把yaml格式转换成字典格式
        :return:
        """
        with open(self.yaml_file,encoding='utf-8') as f:
           value = yaml.load(f,Loader=yaml.FullLoader)
           print (value)

if __name__ == '__main__':
    YamlUtil("../test_api.yaml").read_yaml()